**Do file for comparison of autocorrelations and modes

use "C:\Users\Diana Mutz\Dropbox\_Sevdenur\2025Final\WideFormModeanalyses_Intercorrs.dta"


***
tab orphone

replace orphone=0 if orphone==.
tab orphone

***comparing same wave corrs with overtime autocorrs amogn adjacent waves for IOs

**single point in time

polychoric untrust_2 natotrust_2 wtotrust_2 whotrust_2
polychoric untrust_5 natotrust_5 wtotrust_5
polychoric untrust_6 natotrust_6 wtotrust_6 whotrust_6
polychoric untrust_7 natotrust_7 wtotrust_7 whotrust_7
polychoric untrust_9 natotrust_9 wtotrust_9

**Auto corrs
  
polychoric untrust_2 untrust_5 untrust_6 untrust_7 untrust_9
polychoric natotrust_2 natotrust_5 natotrust_6 natotrust_7 natotrust_9
polychoric wtotrust_2 wtotrust_5 wtotrust_6 wtotrust_7 wtotrust_9
polychoric whotrust_2  whotrust_6 whotrust_7 

***index comparison


egen ioindex_2=rowmean(untrust_2 natotrust_2 wtotrust_2 whotrust_2)
egen ioindex_5=rowmean(untrust_5 natotrust_5 wtotrust_5)
egen ioindex_6=rowmean(untrust_6 natotrust_6 wtotrust_6 whotrust_6)
egen ioindex_7=rowmean(untrust_7 natotrust_7 wtotrust_7 whotrust_7)
egen ioindex_9=rowmean(untrust_9 natotrust_9 wtotrust_9 )


polychoric ioindex_2 ioindex_5 ioindex_6 ioindex_7 ioindex_9


***Comparing to items in Immigration GRID

   ***single point in time
  
polychoric pathtocit_1 agstfence_1 agstreturn_1
polychoric pathtocit_2 agstfence_2 agstreturn_2
polychoric pathtocit_3 agstfence_3 agstreturn_3
polychoric pathtocit_4 agstfence_4 agstreturn_4
polychoric pathtocit_5 agstfence_5 agstreturn_5
polychoric pathtocit_6 agstfence_6 agstreturn_6
polychoric pathtocit_7 agstfence_7 agstreturn_7
polychoric pathtocit_8 agstfence_8 agstreturn_8
polychoric pathtocit_9 agstfence_9 agstreturn_9

**autocorrs over time

polychoric pathtocit_1 pathtocit_2 pathtocit_3 pathtocit_4 pathtocit_5 pathtocit_6 pathtocit_7  pathtocit_8 pathtocit_9
polychoric agstfence_1 agstfence_2 agstfence_3 agstfence_4 agstfence_5 agstfence_6 agstfence_7  agstfence_8 agstfence_9
polychoric agstreturn_1 agstreturn_2 agstreturn_3 agstreturn_4 agstreturn_5 agstreturn_6 agstreturn_7  agstreturn_8 agstreturn_9
